using System.Transactions;
using IBLLStrategy;

namespace BLL
{
    public class ProductTypeSynchronous:IProductTypeStrategy 
    {
        private static readonly IDAL.IProductType dal = DALFactory.DataAccess.CreateProductType();

        /// <summary>
        /// Inserts the productType within a transaction.
        /// </summary>
        /// <param name="productType">All information about the productType</param>
        public void Insert(Model.ProductTypeInfo productType)
        {

            using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
            {

                dal.Insert(productType);

                ts.Complete();
            }
        }
    }
}
